package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.enumclass.WithdrawStatus;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created by DK on 16/12/9.
 * 商家提现
 */
@Entity
@Table(name = "merchant_withdraw")
@DynamicInsert
@DynamicUpdate
public class MerchantWithdraw extends IDEntityMall{

    @Column(columnDefinition = "bigint comment '平台ID'")
    private Long mallId;

    @Column(columnDefinition = "bigint comment '申请提现人ID'")
    private Long merchantId;

    @Column(columnDefinition = "varchar(50) comment '申请提现人'")
    private String merchantName;

    @Column(columnDefinition = "DECIMAL(30,10) DEFAULT 0 comment '提现金额'")
    private BigDecimal amount;

    @Column(columnDefinition = "varchar(50) comment '银行名称'")
    private String bankName;

    @Column(columnDefinition = "varchar(50) comment '支行银行名称'")
    private String bankBranchName;

    @Column(columnDefinition = "varchar(50) comment '银行卡号'")
    private String bankNo;

    @Column(columnDefinition = "varchar(100) comment '开户名'")
    private String bankAccountName;

    @Column(columnDefinition = "varchar(200) comment '提现状态")
    @Enumerated(EnumType.STRING)
    private WithdrawStatus status = WithdrawStatus.WAIT_AUDIT;

    @Column(columnDefinition = "varchar(255) comment '备注'")
    private String remark;

    @Column(columnDefinition = "text comment '转账凭证URL'")
    private String certificateUrl;

    @Column(columnDefinition = "varchar(255) comment '交易流水号 提现成功,才有值'")
    private String transactionId;

    @Column(columnDefinition = "varchar(255) comment '提现帐号信息'")
    private String bankInfo;

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBankNo() {
        return bankNo;
    }

    public void setBankNo(String bankNo) {
        this.bankNo = bankNo;
    }

    public String getBankAccountName() {
        return bankAccountName;
    }

    public void setBankAccountName(String bankAccountName) {
        this.bankAccountName = bankAccountName;
    }

    public WithdrawStatus getStatus() {
        return status;
    }

    public void setStatus(WithdrawStatus status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCertificateUrl() {
        return certificateUrl;
    }

    public void setCertificateUrl(String certificateUrl) {
        this.certificateUrl = certificateUrl;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getBankInfo() {
        return bankInfo;
    }

    public void setBankInfo(String bankInfo) {
        this.bankInfo = bankInfo;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public String getBankBranchName() {
        return bankBranchName;
    }

    public void setBankBranchName(String bankBranchName) {
        this.bankBranchName = bankBranchName;
    }

    @Override
    public String toString() {
        return "MerchantWithdraw{" +
                "mallId=" + mallId +
                ", merchantId=" + merchantId +
                ", merchantName='" + merchantName + '\'' +
                ", amount=" + amount +
                ", bankName='" + bankName + '\'' +
                ", bankBranchName='" + bankBranchName + '\'' +
                ", bankNo='" + bankNo + '\'' +
                ", bankAccountName='" + bankAccountName + '\'' +
                ", status=" + status +
                ", remark='" + remark + '\'' +
                ", certificateUrl='" + certificateUrl + '\'' +
                ", transactionId='" + transactionId + '\'' +
                ", bankInfo='" + bankInfo + '\'' +
                '}';
    }
}
